From 1cec819c3070c21d90eac9a7ab27717499e75239 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Thu, 23 Aug 2012 10:26:29 +0200 Subject: [PATCH] Adjust constants used for sRGB gamma Spotted by Elle Stone and clarified by Graeme Gill, now updated to Current IEC specification values. --- babl/base/util.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/babl/base/util.h b/babl/base/util.h index edb3105..6888ddc 100644 --- a/babl/base/util.h +++ b/babl/base/util.h @@ -60,11 +60,11 @@ static inline double linear_to_gamma_2_2 (double value) { #if 0 - if (value > 0.0030402477F) + if (value > 0.003130804954) return 1.055F * pow (value, (1.0F/2.4F)) - 0.055F; return 12.92F * value; #else - if (value > 0.0030402477F) + if (value > 0.003130804954) return 1.055F * babl_pow_1_24 (value) - 0.055F; return 12.92F * value; #endif @@ -74,11 +74,11 @@ static inline double gamma_2_2_to_linear (double value) { #if 0 - if (value > 0.03928F) + if (value > 0.04045F) return pow ((value + 0.055F) / 1.055F, 2.4F); return value / 12.92F; #else - if (value > 0.03928F) + if (value > 0.04045F) return babl_pow_24 ((value + 0.055F) / 1.055F); return value / 12.92F; #endif -- 2.30.2